/**
 * 2015年10月18日19:48:42
 */

var controllers = angular.module('organization_controllers', []);
/*消息推送数据*/
controllers.controller('CtrlBody', ['$scope', '$window',
    function ($scope, $window) {
        //屏蔽body中双击选中文本
        angular.element("body").dblclick(function () {
            if (document.selection && document.selection.empty) {
                document.selection.empty();
            }
            else if (window.getSelection) {
                var sel = window.getSelection();
                sel.removeAllRanges();
            }
        });

    }]);
controllers.controller('CtrlIndex', ['$scope', '$window',
    function ($scope, $window) {

    }]);
controllers.controller('CtrlIndex', ['$scope', '$window',
    function ($scope, $window) {

    }]);
controllers.controller('CtrlOrganizationNode', ['$scope', '$window','OrganizationNodeService',
    function ($scope, $window,OrganizationNodeService) {
        $scope.organizationNodes = OrganizationNodeService.query();
        $scope.organizationNodeEnableFilterInput = "";
        $scope.organizationNodeEnableTrueFilterInput = true;
        $scope.organizationNodeEnableFalseFilterInput = true;
        $scope.organizationNodeContentLeftDateFilterStartDateInput=null;
        $scope.organizationNodeContentLeftDateFilterEndDateInput=null;
        $scope.organizationNodeEnableFilterInputChange=function(){
            if($scope.organizationNodeEnableTrueFilterInput==true
                &&$scope.organizationNodeEnableFalseFilterInput==true){
                $scope.organizationNodeEnableFilterInput="";
            }else if($scope.organizationNodeEnableTrueFilterInput==true
                &&$scope.organizationNodeEnableFalseFilterInput==false){
                $scope.organizationNodeEnableFilterInput=true;
            }else if($scope.organizationNodeEnableTrueFilterInput==false
                &&$scope.organizationNodeEnableFalseFilterInput==true){
                $scope.organizationNodeEnableFilterInput=false;
            }else if($scope.organizationNodeEnableTrueFilterInput==false
                &&$scope.organizationNodeEnableFalseFilterInput==false){
                $scope.organizationNodeEnableFilterInput=null;
            }
        };
    }]);

controllers.controller('CtrlOrganizationNodeItem', ['$rootScope','$scope', '$window','OrganizationNodeService',
    function ($rootScope,$scope, $window,OrganizationNodeService) {
        $scope.organizationNodeCode=$rootScope.$stateParams.organizationNodeCode;
        //console.log($scope.organizationNodeCode);
    }]);
controllers.controller('CtrlOrganizationNodeItemBasic', ['$rootScope','$scope', '$window','OrganizationNodeService',
    function ($rootScope,$scope, $window,OrganizationNodeService) {
        //console.log($scope.organizationNodeCode);
    }]);
controllers.controller('CtrlOrganizationNodeItemHistory', ['$rootScope','$scope', '$window','OrganizationNodeService',
    function ($rootScope,$scope, $window,OrganizationNodeService) {
        //console.log($scope.organizationNodeCode);
    }]);
controllers.controller('CtrlOrganizationNodeItemPosition', ['$rootScope','$scope', '$window','OrganizationNodeService',
    function ($rootScope,$scope, $window,OrganizationNodeService) {
        //console.log($scope.organizationNodeCode);
    }]);
controllers.controller('CtrlOrganizationNodeItemEmployee', ['$rootScope','$scope', '$window','OrganizationNodeService',
    function ($rootScope,$scope, $window,OrganizationNodeService) {
    //console.log($scope.organizationNodeCode);
}]);
controllers.controller('CtrlPosition', ['$rootScope','$scope', '$window','PositionService',
    function ($rootScope,$scope, $window,PositionService) {
        $scope.positions = PositionService.query();
        $scope.positionEnableFilterInput = "";
        $scope.positionEnableTrueFilterInput = true;
        $scope.positionEnableFalseFilterInput = true;
        $scope.positionContentLeftDateFilterStartDateInput=null;
        $scope.positionContentLeftDateFilterEndDateInput=null;
        $scope.positionEnableFilterInputChange=function(){
            if($scope.positionEnableTrueFilterInput==true
                &&$scope.positionEnableFalseFilterInput==true){
                $scope.positionEnableFilterInput="";
            }else if($scope.positionEnableTrueFilterInput==true
                &&$scope.positionEnableFalseFilterInput==false){
                $scope.positionEnableFilterInput=true;
            }else if($scope.positionEnableTrueFilterInput==false
                &&$scope.positionEnableFalseFilterInput==true){
                $scope.positionEnableFilterInput=false;
            }else if($scope.positionEnableTrueFilterInput==false
                &&$scope.positionEnableFalseFilterInput==false){
                $scope.positionEnableFilterInput=null;
            }
        };
        $scope.positionImportantTrueFilterInput = true;
        $scope.positionImportantFalseFilterInput = true;
        $scope.positionImportantFilterInputChange=function(){
            if($scope.positionImportantTrueFilterInput==true
                &&$scope.positionImportantFalseFilterInput==true){
                $scope.positionImportantFilterInput="";
            }else if($scope.positionImportantTrueFilterInput==true
                &&$scope.positionImportantFalseFilterInput==false){
                $scope.positionImportantFilterInput=true;
            }else if($scope.positionImportantTrueFilterInput==false
                &&$scope.positionImportantFalseFilterInput==true){
                $scope.positionImportantFilterInput=false;
            }else if($scope.positionImportantTrueFilterInput==false
                &&$scope.positionImportantFalseFilterInput==false){
                $scope.positionImportantFilterInput=null;
            }
        };
    }]);
controllers.controller('CtrlPositionItem', ['$rootScope','$scope', '$window','PositionService',
    function ($rootScope,$scope, $window,OrganizationNodeService) {
        //console.log($scope.organizationNodeCode);
        $scope.positionCode=$rootScope.$stateParams.positionCode;
    }]);
controllers.controller('CtrlPositionItemBasic', ['$rootScope','$scope', '$window','PositionService',
    function ($rootScope,$scope, $window,OrganizationNodeService) {
        //console.log($scope.organizationNodeCode);
    }]);